/*
 * freePCB.c
 *
 *  Created on: Sep 29, 2013
 *      Author: Alex Bouvy
 */

#include <stdlib.h>
#include "mpx_pcb.h"
#include "mpx_supt.h"

/*
 * freePCB()
 * Written by Alex Bouvy
 * Uses the support function sys_free_mem to free all the memory associated with a pcb
 *	Params:
 *	Pointer to pcb to free
 * 
 *	Returns:
 *      Nothing OR error/success code
 * 
 */
int freePCB(struct MPX_PCB *pcb){
	int r_stack, r_pcb;
	//r_stack = sys_free_mem((*pcb).stack_base);
	r_pcb = sys_free_mem((pcb));
	return r_stack + r_pcb;
}
